﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using LabMS.DAL;
namespace ExtendBLL
{
    public class GoodsMaintain : LabMS.BLL.GoodsMaintain
    {
        /// <summary>
        /// 获得扩展数据列表
        /// </summary> 
        public List<ExtendModule.GoodsMaintain> GetExtendModuleList(string strWhere)
        {
            DataSet ds = dal.GetInnerList(strWhere);
            List<ExtendModule.GoodsMaintain> modelList = new List<ExtendModule.GoodsMaintain>();
            int rowsCount = ds.Tables[0].Rows.Count;
            if (rowsCount > 0)
            {
                ExtendModule.GoodsMaintain model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new ExtendModule.GoodsMaintain();
                    model.ID = Convert.ToInt32(ds.Tables[0].Rows[n]["ID"]);
                    model.Numbers = ds.Tables[0].Rows[n]["Numbers"].ToString();
                    model.Name = ds.Tables[0].Rows[n]["Name"].ToString();
                    model.LabName = ds.Tables[0].Rows[n]["LabName"].ToString();
                    model.AssetManagers = ds.Tables[0].Rows[n]["AssetManagers"].ToString();
                    model.Tel = ds.Tables[0].Rows[n]["Tel"].ToString();
                    model.StorageSites = ds.Tables[0].Rows[n]["StorageSites"].ToString();
                    model.Guarantee = ds.Tables[0].Rows[n]["Guarantee"].ToString();
                    model.Applicant = ds.Tables[0].Rows[n]["Applicant"].ToString();
                    model.Status = ds.Tables[0].Rows[n]["Status"].ToString();
                    if (ds.Tables[0].Rows[n]["ReportedTime"].ToString() != "")
                    {
                        model.ReportedTime = DateTime.Parse(ds.Tables[0].Rows[n]["ReportedTime"].ToString());
                    }
                    model.Describe = ds.Tables[0].Rows[n]["Describe"].ToString();
                    model.Preson = ds.Tables[0].Rows[n]["Preson"].ToString();
                    model.MCo = ds.Tables[0].Rows[n]["MCo"].ToString();
                    model.MLinkman = ds.Tables[0].Rows[n]["MLinkman"].ToString();
                    model.MPhone = ds.Tables[0].Rows[n]["MPhone"].ToString();
                    if (ds.Tables[0].Rows[n]["MDate"].ToString() != "")
                    {
                        model.MDate = DateTime.Parse(ds.Tables[0].Rows[n]["MDate"].ToString());
                    }
                    model.MComment = ds.Tables[0].Rows[n]["MComment"].ToString();
                    model.MPerson = ds.Tables[0].Rows[n]["MPerson"].ToString();
                    model.AcceptanceViews = ds.Tables[0].Rows[n]["AcceptanceViews"].ToString();
                    model.APerson = ds.Tables[0].Rows[n]["APerson"].ToString();
                    if (ds.Tables[0].Rows[n]["ATime"].ToString() != "")
                    {
                        model.ATime = DateTime.Parse(ds.Tables[0].Rows[n]["ATime"].ToString());
                    }
                    model.Model = ds.Tables[0].Rows[n]["Model"].ToString();
                    modelList.Add(model);
                }
            }
            return modelList;

        }
    }
}
